% ctex-fontset-windows.def: Windows 的字体设置，默认为六种中易字体及微软雅黑
% vim:ft=tex

\ifCTEX@engines{xeCJK}{LuaCJK}{
  \IfFileExists{C:/boot.ini}{% Windows XP 或更早，不保证有雅黑
    \setCJKmainfont[BoldFont=SimHei,ItalicFont=KaiTi_GB2312]{SimSun}
    \setCJKsansfont{SimHei}
    \setCJKmonofont{FangSong_GB2312}
    \setCJKfamilyfont{zhkai} {KaiTi_GB2312}
    \setCJKfamilyfont{zhfs}  {FangSong_GB2312}
  }{% Windows Vista 或更晚
    \setCJKmainfont[BoldFont=SimHei,ItalicFont=KaiTi]{SimSun}
    \setCJKsansfont[BoldFont={* Bold}]{Microsoft YaHei}
    \setCJKmonofont{FangSong}
    \setCJKfamilyfont{zhkai} {KaiTi}
    \setCJKfamilyfont{zhfs}  {FangSong}
  }
  \setCJKfamilyfont{zhsong}{SimSun}
  \setCJKfamilyfont{zhhei} {SimHei}
  \setCJKfamilyfont{zhli}  {LiSu}
  \setCJKfamilyfont{zhyou} {YouYuan}
  \setCJKfamilyfont{zhyahei}[BoldFont={* Bold}]{Microsoft YaHei}
}{
  \ifCTEX@engine{zhmCJK}{
    \setCJKmainfont[BoldFont=simhei.ttf, ItalicFont=simkai.ttf]{simsun.ttc}
    \IfFileExists{C:/boot.ini}{% Windows XP 或更早
      \setCJKsansfont{simhei.ttf}
    }{% Windows Vista 或更晚
      \setCJKsansfont[BoldFont=msyhbd.ttf]{msyh.ttf}
    }
    \setCJKmonofont{simfang.ttf}
    \setCJKfamilyfont{zhkai} {simkai.ttf}
    \setCJKfamilyfont{zhfs}  {simfang.ttf}
    \setCJKfamilyfont{zhsong}{simsun.ttc}
    \setCJKfamilyfont{zhhei} {simhei.ttf}
    \setCJKfamilyfont{zhli}  {simli.ttf}
    \setCJKfamilyfont{zhyou} {simyou.ttf}
	\setCJKfamilyfont{zhyahei}[BoldFont=msyhbd.ttf]{msyh.ttf} % ??? Windows 8 使用 .ttc 后缀
  }{
    \ifbool{CTEX@zhmap}
      {\CTEX@inputzhmap{zhwinfonts}}
      {
        \def\CJKrmdefault{rm}
        \def\CJKsfdefault{sf}
        \def\CJKttdefault{tt}
      }
  }
}

\newcommand*\songti  {\CJKfamily{zhsong}}  % 宋体
\newcommand*\heiti   {\CJKfamily{zhhei}}   % 黑体
\newcommand*\kaishu  {\CJKfamily{zhkai}}   % 楷书
\newcommand*\fangsong{\CJKfamily{zhfs}}    % 仿宋
\newcommand*\lishu   {\CJKfamily{zhli}}    % 隶书
\newcommand*\youyuan {\CJKfamily{zhyou}}   % 幼圆
\newcommand*\yahei   {\CJKfamily{zhyahei}} % 微软雅黑

\endinput
